<template>
    <el-cascader :props="checkstrictly" @change="change" filterable style="width:100%" v-model="optiondata" clearable :options="addressOptions" cle></el-cascader>
</template>

<script>
export default {
    props: {
        type:{
            type:Number,
        },
		treeoption:{
			type:Array,
		},
		checkstrictly:{
			type:Object,
		},
		is_clear:{
            type:Boolean,
            default:false
        },
    },
	watch:{
		is_clear(val){
			if(val){
				this.addressOptions = []
			}
		}
	},
	data(){
		return{
			optiondata:this.treeoption,
			addressOptions:[],
		}
	},
    mounted(){
        this.init()
    },
    methods: {
        init(){
            this.$axios.post('/admin/Base/getShenshiqu',{type:this.type}).then(response => {
                this.addressOptions = response.data.data
            })
        },
		change(val){
			this.$emit('update:treeoption',val)
		}
    },
}
</script>